package com.luoxiang.socialandroid.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.netease.yunxin.kit.chatkit.ui.R
import com.netease.yunxin.kit.chatkit.ui.dialog.GiftDialog
import com.netease.yunxin.kit.chatkit.ui.model.Gift

class GiftAdapter(data: MutableList<Gift>) : BaseQuickAdapter<Gift,BaseViewHolder>(R.layout.item_chat_gift,data) {

    override fun convert(holder: BaseViewHolder, item: Gift) {
        holder.apply {
            Glide.with(context)
                .load("https://dahuixiong.oss-cn-shenzhen.aliyuncs.com/"+item.icon)
                .into(getView(R.id.imageCover))
            setText(R.id.textTitle,item.name)
            setText(R.id.textCoin,item.coin.toString()+context.getString(com.luoxiang.socialandroid.R.string.mi_mi))
            setGone(R.id.view,!(item == GiftDialog.clickItem))
        }
    }
}